import { Component, OnInit } from '@angular/core';
import { Prroducts } from '../data/product';
import {MatDialog} from '@angular/material';
import {PrintComponent} from './print/print.component';

@Component({
  selector: 'app-order',
  templateUrl: './order.component.html',
  styleUrls: ['./order.component.scss']
})
export class OrderComponent implements OnInit {
  products = Prroducts;
  formData: any = {
    currentPro: '',
    width: 500,
    height: 400,
    userName: '缺少值',
    prodNum: '123456709012',
    remark: '',
    time: ''
  };
  constructor(private dialog: MatDialog) { }

  ngOnInit() {
  }

  addProdHandle() {

  }

  changeHandle() {
  }

  onClickPrint() {
    let dialogReg = this.dialog.open(PrintComponent, {
      width: '100%',
      data: {
        info: this.formData
      },
      panelClass: 'print-dialog'
    });
  }

}
